package com.tpyule.tpclass.dao;

import com.tpyule.tpclass.entity.bo.SectionStudyBo;
import com.tpyule.tpclass.entity.pojo.Section;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author zzz
 * @version 1.0
 * @date 2020/3/29 20:41
 */
@Mapper
public interface SectionDao {
    public List<Section> getListSectionByChapterId(String chapterId);
    public int updateSection(Section section);
    public int updateBigSection(Section section);
    public int addSection(Section section);

    /**
     * 获取课程的章节总数量
     * @param courseId 课程ID
     * @return
     */
    public int getSectionSize(String courseId);

    public List<SectionStudyBo> getSectionStudy(@Param("chapterId") String chapterId, @Param("userId") String userId);


    /**
     * 根据节ID获取节对象
     * @param sectionId
     * @return
     */
    public Section getSection(String sectionId);

    /**
     * 获取课程的第一个节
     * @param courseId
     * @return
     */
    public Section getIndexSection(String courseId);


}
